#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/types.h>
int main(void)
{
pid_t pid;
if((pid=fork())<0)
{
printf("明显，你看到这个就是错误的\n");
exit(2);	//这里exit（）里的参数只要不是0都表示异常退出
}
else if(pid==0)
{
printf(" 这是子进程，PID是： %ld \t",(long)getpid()); //还要我输出'hello world'
printf(" \n hello world \n");
}
else
{
printf(" 这是父进程，PID是:  %ld \t",(long)getpid()); //还要我输出'welcome to mrsoft'? 我偏要输出'welcome to openSuSE !'
printf(" \n welcome to openSuSE !\n");
exit(0);
}
return 0;
}
